<?php

use yii\db\Migration;

/**
 * Class m220127_095618_rbac_add_role_base_user
 */
class m220127_095618_rbac_add_role_base_user extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $auth = Yii::$app->authManager;

        $userRole = $auth->createRole('baseUser');
        $auth->add($userRole);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $auth = Yii::$app->authManager;

        $auth->remove($auth->getRole('baseUser'));
    }
}
